from csagent.core.node.base_node import BaseNode
from csagent.core.context import AgentState
import time
class Node(BaseNode):
    def initialize(self):
        """初始化节点"""
        print(self.conf)
        print('intent Node初始化成功')
    def execute(self, state: AgentState, stream_writer=None) -> AgentState:
        print(f"[意图]intent node开始执行")
        query = state['messages'][-1]['content']
        print(f"[意图]query:{query}")
        print("[意图]意图识别中")
        time.sleep(1)
        state['node_context']['intent'] = ["recommend","deepresearch"]
        print(f"[意图]intent node执行完成")
        return state